// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
@import "common/common.scss";
@import "common/colors.scss";
@import "editor/index.scss";

@import "components/components.scss";
@import "theme.scss";

@import "../src/fabric-icons/css/fabric-icons-inline";

// Application Layout Rules

html {
  overflow: hidden;
  height: 100%;
}

body {
  height: 100%;
  overflow: auto;
  touch-action: none;
  cursor: default;

  @include disable-user-select;
  @include font-main;
}

@font-face {
  font-family: "Segoe UI Bold";
  src: local("Segoe UI bold"), local("Segoe bold"), local("Segoe WP bold");
  font-weight: normal;
  font-style: normal;
}

li::marker {
  list-style: none;
  background-image: none;
  background-repeat: none;
  background-position: 0;
}

// CSS Rule format:
// module__element-subelement--variant

.charticulator {
  &__application {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    color: $theme-primary-foreground;
  }

  &-title__button {
    background: $theme-application-title-background;
    color: $theme-application-title-foreground;
    padding: 10px;
  }

  &-title__button .el-text {
    font-weight: $theme-application-title-font-weight;
  }

  &__menu-bar {
    background: $theme-header-background;

    display: flex;
    flex-direction: row;
    color: $theme-header-foreground;
    justify-content: space-between;

    &-left {
      display: flex;
      align-items: center;
      // flex: 1;
    }
    &-center {
      display: flex;
      align-self: center;
      justify-self: center;
      // flex: 1;

      .nested-chart {
        background-color: $nested-chart-header-color;
        color: black;
        height: 20px;
        display: block;
        margin-top: 4px;
        margin-bottom: 4px;
        padding-top: 4px;
        padding-left: 4px;
        padding-right: 4px;
        text-align: center;
      }
    }
    &-right {
      display: flex;
      align-items: center;
      flex-shrink: 0;
      margin-right: 4px;
    }

    &-separator {
      height: 24px;
      margin: 4px 0;
      display: inline-block;
      vertical-align: top;
      width: 0px;
      border-left: 1px solid $gray-080;
    }

    .charticulator__button-menu-text {
      flex-shrink: 0;
    }
  }

  &__menu-popup {
    .popup-view {
      // &:before {
      //     // Remove the triangle
      //     display: none
      // };
      margin: 0px;
      margin-top: 8px;
      margin-right: 5px;
    }
  }
  &__menu-dropdown {
    .el-item {
      height: 32px;
      line-height: 32px;
      a {
        display: block;
        height: 32px;
        line-height: 32px;
        padding: 0 8px;
        &,
        &:hover,
        &:active,
        &:focus {
          text-decoration: none;
        }
        color: $black;
        &:hover,
        &:active {
          background: unset;
        }
      }
    }
    .el-item-version {
      font-size: 12px;
      height: 24px;
      line-height: 24px;
      padding: 0 8px;
      color: $gray-150;
    }
  }

  &__panel-container {
    display: flex;
    flex: 1;
    flex-direction: row;

    // Drop a shadow to the menu-bar
    // box-shadow: 0 0 5px black;
    z-index: 5;
    overflow: hidden;
  }

  &__panel-editor,
  &__panel-editor-panel {
    background: $theme-editor-pane-background;
    color: $theme-editor-pane-foreground;
  }

  &__panel {
    $panel-color: $theme-primary-background;
    $panel-border-color: #c8c6c4;
    $panel-border-width: 1px;

    display: flex;
    flex-direction: column;
    background: $panel-color;

    &-dataset {
      flex-shrink: 0;
      max-width: 250px;
      min-width: 200px;
      overflow: hidden;
      box-sizing: border-box;
      background: $theme-dataset-background;
      border-right: $panel-border-width solid $panel-border-color;
      border-left: $panel-border-width solid $panel-border-color;
      // padding: 10px;
      // overflow-y: scroll;
      // z-index: 10;
      // box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    }

    &-editor {
      flex: 1;
      overflow: hidden;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      font-size: 14px;

      &-toolbar-horizontal {
        display: flex;
        flex-direction: row;
        padding-top: 4px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 4px;
        background: $gray-230;
        border-bottom: $panel-border-width solid $panel-border-color;
        border-left: $panel-border-width solid $panel-border-color;
        // z-index: 9;
        // box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      }

      &-toolbar-vertical {
        padding: 10px;
        background: $gray-230;
        border-bottom: $panel-border-width solid $panel-border-color;

        border-right: 1px solid $gray-190;
        border-left: 1px solid $gray-190;
        // z-index: 9;
        // box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
        // display: grid;
        // grid-auto-flow: column;
        // grid-template-rows: "repeat(30, auto)";
      }

      &-panel-container {
        display: flex;
        flex: 1;
        flex-direction: row;
        overflow: hidden;
      }

      &-panel {
        overflow: hidden;

        &-panes {
          max-width: 320px;
          flex-shrink: 0;
          border-right: $panel-border-width solid $panel-border-color;
          border-left: $panel-border-width solid $panel-border-color;
          display: flex;
          flex-direction: column;
        }
        &-chart {
          flex: 1;
          display: flex;
        }
      }
    }
  }

  &__floating-panels {
    position: absolute;
    left: 0;
    top: 0;

    &_errors {
      z-index: 1001;
    }
  }
}
